import random

"""
街头抽奖：

规则：
1、6个筛子抽3次
2、抽中连续的三个数字得奖
"""

daoju = [1, 3, 2, 6, 4, 5]
zhongjiang = [[1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5, 6]]
number = 30
count = 0
for x in range(number):
    jieguo = []
    while (True):
        y = random.choice(daoju)
        if y not in jieguo:
            jieguo.append(y)
        if len(jieguo) == 3:
            jieguo.sort()
            if jieguo in zhongjiang:
                print(jieguo, "中奖了！")
                count = count + 1
            else:
                print(jieguo)
            break
print("抽奖%s次，中奖%s次。" % (number, count))

chengben = number * 0.5
xiaoshoujieguo = 2*(number-count)
lirun=xiaoshoujieguo-chengben
print("小贩购买%s件商品成本%s元" % (number, chengben))
print("中奖%s次，未中奖%s次，未中奖需用2元/件购买商品，销售结果为%s元，利润为%s元。" % (count, number - count, xiaoshoujieguo,lirun))